package tomsung.cloud.agdc.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import tomsung.cloud.agdc.bean.CropType;
import tomsung.cloud.agdc.dao.CropTypeMapper;

@Service("CropTypeService")
public class CropTypeService {

	@Autowired
	CropTypeMapper cropTypeMapper;
	
	public int createCropType(CropType record)
	{
		return cropTypeMapper.insertSelective(record);
	}
	
	public int deleteCropType(Integer cropType)
	{
		return cropTypeMapper.deleteByPrimaryKey(cropType);
	}
	
	public CropType selectCropType(Integer cropType)
	{
		return cropTypeMapper.selectByPrimaryKey(cropType);
	}
	
	public int updateCropType(CropType record)
	{
		return cropTypeMapper.updateByPrimaryKey(record);
	}
	
	public List<CropType> getAllCropTypes()
	{
		return cropTypeMapper.getAllCropTypes();
	}
	
	public int selectMaxCropType()
	{
		return cropTypeMapper.selectMaxCropType();
	}
}
